<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
/**
 *
 * @author Joker
 *
 */
class UserExamHistory extends Model
{

    protected $table='user_exam_history';


    protected $fillable = ['id','job_id','company_id','scores','questions_id','user_answer','answer'];

    /**
     * 获取职位信息
     * @return [type] [description]
     */
    public function jobs()
    {
        return $this->belongsTo('App\Models\CompanyJobs', 'job_id');
    }

    /**
     * 试卷信息
     * @return [type] [description]
     */
    public function examination()
    {
        return $this->belongsTo('App\Models\Examination', 'exam_id');
    }

    /**
     * 试题信息
     * @return [type] [description]
     */
    public function question()
    {
        return $this->belongsTo('App\Models\Questions', 'id');
    }

    /**
     * 公司企业信息
     * @return [type] [description]
     */
    public function company()
    {
        return $this->belongsTo('App\Models\Company', 'company_id');
    }
}